package com.gzbsoft.sc.modules.sys.entity;
import io.ebean.annotation.DbComment;
import io.ebean.annotation.DocEmbedded;
import io.ebean.annotation.DocStore;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
@DocStore
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@Entity
@DbComment("商品分类表")
@Table(name = "jx_good_sort")
public class JxGoodSort extends BaseEntity {
    @DocEmbedded(doc = "id")
    @DbComment("父级编号")
    @ManyToOne
    @JoinColumn(name = "parent_id")
    private JxGoodSort parent;
    @DbComment("名称")
    private String name;
    @DbComment("是否展开")
    private String spread;
    @DbComment("链接")
    private String href;
    @DbComment("分类的状态")
    private String status;
    @DbComment("icon")
    private String icon;
    @DbComment("轮播图")
    private String banner;
    @DocEmbedded
    @DbComment("预置技术参数")
    @OneToOne(fetch = FetchType.EAGER)
    private JxGoodStandard standard;
    @DocEmbedded
    @DbComment("预置产品配置")
    @OneToOne(fetch = FetchType.EAGER)
    private JxGoodSpecs specs;
    @Override
    public String toString() {
        return "JxGoodSort{" +
                "parent=" + parent +
                ", name='" + name + '\'' +
                ", spread='" + spread + '\'' +
                ", href='" + href + '\'' +
                ", status='" + status + '\'' +
                ", icon='" + icon + '\'' +
                ", banner='" + banner + '\'' +
                ", standard=" + standard +
                ", specs=" + specs +
                ", id=" + id +
                '}';
    }
}
